CoglHandle recording_icon; /* icon shown while playing */
+ gboolean draw_cursor;
cairo_surface_t *cursor_image;
int cursor_hot_x;
int cursor_hot_y;
const char *pipeline);
static void recorder_set_file_template (ShellRecorder *recorder,
const char *file_template);
+static void recorder_set_draw_cursor (ShellRecorder *recorder,
+ gboolean draw_cursor);
static void recorder_pipeline_set_caps (RecorderPipeline *pipeline);
static void recorder_pipeline_closed (RecorderPipeline *pipeline);
PROP_STAGE,
PROP_FRAMERATE,
PROP_PIPELINE,
- PROP_FILE_TEMPLATE
+ PROP_FILE_TEMPLATE,
+ PROP_DRAW_CURSOR
};
G_DEFINE_TYPE(ShellRecorder, shell_recorder, G_TYPE_OBJECT);
recorder->state = RECORDER_STATE_CLOSED;
recorder->framerate = DEFAULT_FRAMES_PER_SECOND;
+ recorder->draw_cursor = TRUE;
}
static void
GST_BUFFER_PTS(buffer) = now - recorder->start_time;
- recorder_draw_cursor (recorder, buffer);
+ if (recorder->draw_cursor)
+ recorder_draw_cursor (recorder, buffer);
shell_recorder_src_add_buffer (SHELL_RECORDER_SRC (recorder->current_pipeline->src), buffer);
gst_buffer_unref (buffer);
g_object_notify (G_OBJECT (recorder), "file-template");
}
+static void
+recorder_set_draw_cursor (ShellRecorder *recorder,
+ gboolean draw_cursor)
+{
+ if (draw_cursor == recorder->draw_cursor)
+ return;
+
+ recorder->draw_cursor = draw_cursor;
+
+ g_object_notify (G_OBJECT (recorder), "draw-cursor");
+}
+
static void
shell_recorder_set_property (GObject *object,
guint prop_id,
case PROP_FILE_TEMPLATE:
recorder_set_file_template (recorder, g_value_get_string (value));
break;
+ case PROP_DRAW_CURSOR:
+ recorder_set_draw_cursor (recorder, g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_FILE_TEMPLATE:
g_value_set_string (value, recorder->file_template);
break;
+ case PROP_DRAW_CURSOR:
+ g_value_set_boolean (value, recorder->draw_cursor);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
"The filename template to use for output files",
NULL,
G_PARAM_READWRITE));
+
+ g_object_class_install_property (gobject_class,
+ PROP_DRAW_CURSOR,
+ g_param_spec_boolean ("draw-cursor",
+ "Draw Cursor",
+ "Whether to record the cursor",
+ TRUE,
+ G_PARAM_READWRITE));
}
/* Sets the GstCaps (video format, in this case) on the stream
}
+void
+shell_recorder_set_draw_cursor (ShellRecorder *recorder,
+ gboolean draw_cursor)
+{
+ g_return_if_fail (SHELL_IS_RECORDER (recorder));
+
+ recorder_set_draw_cursor (recorder, draw_cursor);
+}
+
/**
* shell_recorder_set_pipeline:
* @recorder: the #ShellRecorder